<template>
	<div>
		<van-list @load="getListAndSet">
			<List :list="list"></List>
		</van-list>
	</div>
</template>


<script>
import List from '../../../components/list'
import { fetchHomeList } from '../../../api'
export default {
	data() {
		return {
			list: []
		}
	},
	methods: {
		// 加载数据 
		async getListAndSet() {
			// 请求数据
			const resp = await fetchHomeList()
			// 合拼数据
			this.list = this.list.concat(resp.data.data)
		}
	},
	components: {
		// 挂载组件
		List
	},
	created() {
		// 刚进来 发一次请求
		this.getListAndSet()
	}
}
</script>